void InitList(LinkList *&L){
	L=(LinkList *)malloc(sizeof(LinkList));
	L->next=NULL;
}
void DestroyList(LinkList *&L){
	LinkList *pre=L,*p=L->next;
	while(p!=NULL){
		free(pre);
		pre=p;
		p=pre->next;
	}
	free(pre);
}
void DispList(LinkList *L){
	LinkList *p=L->next;
	while(p!=NULL){
			printf("%c ",p->data);
		    p=p->next; 
		
	}
	printf("\n");
}
bool ListInsert(LinkList *&L,int i,ElemType e){
	int j=0;
	LinkList *p=L,*s;
	if(i<=0)return false;
	else{
		while(j<i-1&&p!=NULL){
		j++;
		p=p->next;
	}
	if(p==NULL)return false;
	else{
		s=(LinkList *)malloc(sizeof(LinkList));
		s->data=e;
		s->next=p->next;
		p->next=s;
		return true;
	}
	}
	
}
bool ListDelete(LinkList *&L,int i,ElemType &e){
	int j=0;
	LinkList *p=L,*q;
	if(i<=0)return false;
	else{
		while(j<i-1&&p!=NULL){
		j++;
		p=p->next;
	}
	if(p==NULL)return false;
	else{
		q=p->next;
		if(q==NULL)return false;
		e=q->data;
		p->next=q->next;
		free(q);
		return true;
	}
	}
	
}
